module.exports = {
  mode: "universal",
  /*
   ** Headers of the page
   */
  head: {
    title: process.env.npm_package_name || "",
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      {
        hid: "description",
        name: "description",
        content: process.env.npm_package_description || ""
      }
    ],
    link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
  },
  /*
   ** Customize the progress-bar color
   */
  loading: { color: "#fff" },
  /*
   ** Global CSS
   */
  css: [
    "element-ui/lib/theme-chalk/index.css",
    "~/assets/bootstrap-scss/bootstrap.scss",
    "~/assets/global.scss"
  ],
  /*
   ** Plugins to load before mounting the App
   */

  plugins: [
    "@/plugins/element-ui",
    "@/plugins/params_convert",
    "@/plugins/util",
    "@/plugins/axios",
    "@/plugins/tui-editor.client.js",
    { src: "@/plugins/localStorage", ssr: false }
  ],
  /*
   ** Nuxt.js modules
   */
  modules: [
    // Doc: https://axios.nuxtjs.org/usage
    "@nuxtjs/axios"
  ],
  /*
   ** Axios module configuration
   ** See https://axios.nuxtjs.org/options
   */
  axios: {
    proxy: true,
    credentials: true
  },
  proxy: {
    "/auth": {
      target: "http://127.0.0.1:8000", // 代理地址
      changeOrigin: true
      // pathRewrite: {
      //   "^/api": "" //将 /api 替换掉
      // }
    },
    "/api": {
      target: "http://127.0.0.1:7246", // 代理地址
      changeOrigin: true
      // pathRewrite: {
      //   "^/api": "" //将 /api 替换掉
      // }
    }
  },
  /*
   ** Build configuration
   */
  build: {
    transpile: [/^element-ui/],
    /*
     ** You can extend webpack config here
     */
    extend(config, ctx) {}
  }
};
